<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-touch-fullscreen" content="YES">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../css/reset.css"/>
<style>
    .op > div {
        display: inline-block;
        float: right;
        margin: 50px 1px 1px 1px;
        position: relative;
    }

    .open-btn {
        width: 50px;
        height: 30px;
        background: url("../img/icon-opert.png") no-repeat;
        z-index: 1;
    }

    .open-con {
        width: 110px;
        height: 30px;
        border-radius: 5px;
        background-color: #242424;
        color: #FFFFFF;
        transition: all 0.5s;
        right: 0px;
        z-index: 0;
        overflow: hidden;
    }

    .open-con1 {
        width: 110px;
        height: 30px;
    }

    .open-con1 > div {
        float: right;
        width: 52px;
        line-height: 29px;
        text-align: center;
    }


</style>
<body>
<div class="op">
    <div class="open-btn" id="open-btn"></div>
    <div class="open-con" id="open-con">
        <div class="open-con1">
            <div>点赞</div>
            <div>评论</div>
        </div>
    </div>
</div>
<script>
    window.onload = function () {
        var _opencon = document.getElementById('open-con');
        document.getElementById('open-btn').onclick = function () {
            if (_opencon.offsetWidth) {
                _opencon.style.width = '0px';// () ('width', '');
            } else {
                _opencon.style.width = '110px';
            }
        }
    }

</script>
</body>
</html>